<template>
  <div class="tool-bar-ri">
    <div class="header-icon">
      <search-menu id="searchMenu"></search-menu>
      <theme-setting id="themeSetting"></theme-setting>
      <message id="message"></message>
      <!-- <fullscreen id="fullscreen"></fullscreen> -->
    </div>
    <span class="username">{{ username }}</span>
    <avatar></avatar>

    <div class="default-setting">
      <el-icon color="#666666" :size="20" class="mini-size" @click="miniSizeWindow">
        <semi-select></semi-select>
      </el-icon>
      <el-icon color="#666666" :size="20" class="close-window" @click="closeWindow">
        <close-bold></close-bold>
      </el-icon>
    </div>
  </div>
</template>

<script setup lang="ts">
import { computed } from "vue";
import { CloseBold, SemiSelect } from "@element-plus/icons-vue";
import SearchMenu from "./components/SearchMenu.vue";
import ThemeSetting from "./components/ThemeSetting.vue";
import Message from "./components/Message.vue";
// import Fullscreen from "./components/Fullscreen.vue";
import Avatar from "./components/Avatar.vue";
import { useUserStore } from "@/stores/modules/user";

const userStore = useUserStore();
const username = computed(() => userStore.userInfo.name);

function miniSizeWindow() {
  window.ipcRendererFunc.miniMin();
}

function closeWindow() {
  window.ipcRendererFunc.closeWindow();
}
</script>

<style scoped lang="scss">
.tool-bar-ri {
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-app-region: no-drag;
  user-select: none;

  .header-icon {
    display: flex;
    align-items: center;

    & > * {
      margin-left: 21px;
      color: var(--el-header-text-color);
    }
  }

  .username {
    margin: 0 20px;
    font-size: 15px;
    color: var(--el-header-text-color);
  }
}

.default-setting {
  display: flex;
  align-items: center;

  i {
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
  }

  .mini-size {
    &:hover {
      background-color: #333333;
    }
  }

  .close-window {
    &:hover {
      background-color: #f43232;
    }
  }
}
</style>